package forum;

import java.util.ArrayList;

import parser.ParserAnnotation;

public class ForumPost {
	private static final long serialVersionUID = -1605404122264185879L;
	private String poster;
	private String postDate;
	private String postTime;
	private String title;
	private String hyperlink;
	private String forumCategory;
	private ArrayList<ForumSentence> sentences;
	private int postId;
	private ParserAnnotation parserAnnotation;
	private ArrayList<ForumTag> forumTags;
	private String source;

	ForumPost(int postId, String poster, String postDate, String time,
			String title, String hyperlink, String forumCategory,
			ArrayList<ForumTag> forumTags, ParserAnnotation pa, String source) {
		this.postId = postId;
		this.poster = poster;
		this.postDate = postDate;
		this.postTime = time;
		this.title = title;
		this.hyperlink = hyperlink;
		this.forumCategory = forumCategory;
		this.forumTags = forumTags;
		sentences = new ArrayList<ForumSentence>();
		this.parserAnnotation = pa;
		this.source = source;
	}

	public ParserAnnotation getParserAnnotation() {
		return parserAnnotation;
	}

	public void setParserAnnotation(ParserAnnotation parserAnnotation) {
		this.parserAnnotation = parserAnnotation;
	}

	public String getPoster() {
		return this.poster;
	}

	public String getPostDate() {
		return this.postDate;
	}

	public String getPostTime() {
		return this.postTime;
	}

	public String getTitle() {
		return this.title;
	}

	public String getHyperlink() {
		return this.hyperlink;
	}

	public ArrayList<ForumSentence> getSentences() {
		return sentences;
	}

	void addSentence(ForumSentence sentence) {
		this.sentences.add(sentence);
	}

	public String toString() {
		String sents = "";
		if (sentences != null) {
			for (ForumSentence fs : sentences)
				sents += "\n" + fs.toString();
		}
		return "Post-" + postId + " " + postDate + " " + postTime + " "
				+ poster + " " + hyperlink + " " + sents;
	}

	public int getPostId() {
		return postId;
	}

	public void setPostId(int postId) {
		this.postId = postId;
	}

	public String getForumCategory() {
		return forumCategory;
	}

	public void setForumCategory(String forumCategory) {
		this.forumCategory = forumCategory;
	}

	public ArrayList<ForumTag> getForumTags() {
		return forumTags;
	}

	public void setForumTags(ArrayList<ForumTag> forumTags) {
		this.forumTags = forumTags;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
}
